package test.format_test;

import java.util.*;

public interface ForInterface{
    void a();
    boolean equals(Object o);
}

class run{
    public static void main(String[] args) {
        bird b1 = new bird();
        //Fly f1 = new bird();
        //f1.fly(); 接口静态方法只能通过接口类名调用
        b1.crawl();
        int time = b1.time;
        Fly.fly();
        Fly ff = new eagle();
        ff.equals(ff);
        eagle e1 = new eagle();
        bird e2 = new eagle();
        //bird e3 = new eagle().clone();
        e1.eat();
        e2.eat();
        eagle.eat();
    }
}

interface Fly{
    static int time =0;
    static void fly(){
        System.out.println("飞行");
    }
    default void crawl(){
        System.out.println("爬行");
    }
}

class bird implements Fly,TestInter{
    static void eat(){
        System.out.println("吃饲料");
    }
}

class eagle extends bird{
    static void eat(){
        System.out.println("吃鹰饲料");
    }
}


class InterFromObj{
    public static void main(String[] args) {
        List a = new ArrayList();
        List b = a;
        System.out.println(a.equals(b));
    }
}

interface TestInter{
    static int i = 1;
    static void view(){
        System.out.println("输出");
    }
}

interface TestInter2{
    static int i = 2;  //static final
    static void view(){
        System.out.println("输出");
    }
}

class TestInterMain{
    public static void main(String[] args) {
        //TestInter.i++;  接口中的属性只能是static final的
        bird a = new bird();
        System.out.println(a.i);
        //a.view(); Static method may be invoked on containing interface class only
    }

}